//
//  HEDiseaseItemCell.m
//  HealthFamily
//
//  Created by 吴欧 on 2020/11/22.
//  Copyright © 2020 honglutec. All rights reserved.
//

#import "HEDiseaseItemCell.h"

@interface HEDiseaseItemCell ()

@property (nonatomic, strong) UIButton *titleBtn;


@end

@implementation HEDiseaseItemCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self initUI];
    }
    return self;
}

- (void)initUI {
    
    _titleBtn = [[QMUIFillButton alloc] initWithFillColor:CNavBgColor titleTextColor:CNavBgFontColor];
    [_titleBtn setTitle:@"-" forState:UIControlStateNormal];
    _titleBtn.userInteractionEnabled = NO;
    _titleBtn.titleLabel.font = DYFont(16);
    _titleBtn.backgroundColor = KHexColor(@"EBF3FE");
    [_titleBtn setTitleColor:CNavBgColor forState:UIControlStateNormal];
    [self.contentView addSubview:_titleBtn];

    [_titleBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).mas_offset(15);
        make.left.equalTo(self.contentView).mas_offset(0);
        make.bottom.equalTo(self.contentView).mas_offset(-0);
    }];
}

- (void)configCellWithModel:(HEAISubItemModel *)model {
    [_titleBtn setTitle: model.content forState:UIControlStateNormal];
    
    [_titleBtn mas_updateConstraints:^(MASConstraintMaker *make) {
        make.width.mas_offset(model.contentWidth);
        make.height.mas_offset(model.contentHeight);
    }];
    
}

@end
